<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="utf-8">
		<title>发表问题</title>
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<link rel="stylesheet" href="/resource/layui/css/layui.css">
		<link rel="stylesheet" href="/resource/css/global.css">
	</head>
	<body>

		<div class="fly-header layui-bg-green">
			<div class="layui-container">
				<a class="fly-logo" href="/user/redirectIndex.do">
					<div class="layui-logo" style="font-size: 20px; color: #CAE1FF;"><span class="iconfont-ali icon-B" style="font-size: 35px"></span></div>
				</a>
			    <ul class="layui-nav fly-nav layui-hide-xs">
			      <li class="layui-nav-item layui-this">
			        <a href="/user/redirectIndex.do"><i class="layui-icon  layui-icon-home"></i>首页</a>
			      </li>
    			</ul>
				<ul class="layui-nav fly-nav-user">
					<!-- 登入后的状态 -->
					<li class="layui-nav-item">
						<a class="fly-nav-avatar" href="/user/redirectIndex.do">
							<cite class="layui-hide-xs">${user.userName }</cite>
				    		<img <c:if test="${!empty user.headSculpture }">src="${user.headSculpture }"</c:if><c:if test="${empty user.headSculpture }">src="/resource/img/logo.JPG"</c:if> alt="${user.userName}">
						</a>
						<dl class="layui-nav-child layui-bg-green">
				    	    <dd><a href="/user/userindex.do"><i class="layui-icon">&#xe609;</i>用户中心</a></dd>
							<dd><a href="/user/userset.do"><i class="layui-icon">&#xe620;</i>基本设置</a></dd>
							<dd><a href="/user/usermessage.do"><i class="iconfont icon-tongzhi" style="top: 4px;"></i>我的消息</a></dd>
							<dd><a href="/user/userhome.do"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
							<hr style="margin: 5px 0;">
							<dd><a href="/user/logout.do" ><i class="iconfont-ali icon-tuichu"></i>退出</a></dd>
						</dl>
					</li>
				</ul>
			</div>
		</div>

		<div class="layui-container fly-marginTop">
			<div class="fly-panel" pad20 style="padding-top: 5px;">
				<div class="layui-form layui-form-pane">
					<div class="layui-tab layui-tab-brief" lay-filter="user">
						<ul class="layui-tab-title">
							<li class="layui-this">发表新帖
								<!-- 编辑帖子 -->
							</li>
						</ul>
						<div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
							<div class="layui-tab-item layui-show">
								<form>
									<div class="layui-row layui-col-space15 layui-form-item">
										<div class="layui-col-md3">
											<label class="layui-form-label">所属标签</label>
											<div class="layui-input-block">
												<select lay-verify="required" name="label" lay-filter="B_label" id="B_label">
													<option></option>
													<option value="视频">视频</option>
													<option value="普通">普通</option>
												</select>
											</div>
										</div>
										<div class="layui-col-md1">
										</div>
										<div class="layui-col-md3">
											<label class="layui-form-label">所属类别</label>
											<div class="layui-input-block">
												<select lay-verify="required" name="category" lay-filter="B_category">
													<option></option>
													<option value="commonEssay">普通帖</option>
													<option value="downLoadEssay">下载帖</option>
												</select>
											</div>
										</div>
										<div class="layui-col-md1">
										</div>
										<div class="layui-col-md3">
											<label class="layui-form-label">权限</label>
											<div class="layui-input-block">
												<select lay-verify="required" name="permission" lay-filter="B_permission">
													<option></option>
													<option value="B_all">所有人可见</option>
													<option value="B_user">仅用户可见</option>
													<option value="B_self">仅自己可见</option>
												</select>
											</div>
										</div>
									</div>
									<div class="layui-row layui-col-space15 layui-form-item " id="B_quiz">
											<div class="layui-col-md12">
											<label for="L_title" class="layui-form-label">标题</label>
											<div class="layui-input-block">
												<input type="text" id="L_title" name="title" required lay-verify="required" autocomplete="off" class="layui-input">
											</div>
										</div>
									</div>
									<fieldset id="upvideo" class="layui-elem-field layui-field-title layui-hide" style="margin-top: 30px;">
										<legend>上传视频(仅限一个)</legend>
									</fieldset>
									<button type="button" class="layui-btn layui-hide" id="uploadvideobtn"><i class="layui-icon"></i>上传视频</button>
									<div id="videoContent" class="layui-col-md12"></div>
									<div class="layui-upload">
									  <button type="button" class="layui-btn layui-btn-normal layui-hide" id="downloadFileB">选择多文件</button> 
									  <div class="layui-upload-list layui-hide" id="downLoadFileListF">
									    <table class="layui-table">
									      <thead>
									        <tr><th>文件名</th>
									        <th>大小</th>
									        <th>状态</th>
									        <th>操作</th>
									      </tr></thead>
									      <tbody id="downLoadFileList"></tbody>
									    </table>
									  </div>
									</div> 
									<hr class="layui-bg-green">
									<div id="commonEssayF" class="layui-form-item layui-form-text layui-hide">
										<div class="layui-input-block">
											<textarea id="L_content" name="content" required lay-verify="content" placeholder="详细描述" class="layui-textarea fly-editor"style="height: 260px;"></textarea>
										</div>
									</div>
									<div id="commonEssay" class="layui-form-item layui-hide">
										<div class="layui-inline">
											<label class="layui-form-label">真实度</label>
											<div class="layui-input-inline" style="width: 190px;">
												<input type="text" id="B_validity" name="validity" value="0" autocomplete="off" class="layui-input"
												 readonly>
											</div>
											<div class="layui-form-mid layui-word-aux">文章的真实性，最初默认为0,不可修改</div>
										</div>
									</div>
									<div id="downLoadEssay" class="layui-form-item layui-hide">
										<div class="layui-inline">
											<label class="layui-form-label">下载积分</label>
											<div class="layui-input-inline" style="width: 190px;">
												<input type="text" id="B_integration" name="integration" value="0" autocomplete="off" class="layui-input">
											</div>
											<div id="B_integration" class="layui-form-mid layui-word-aux">请输入需要的积分，发布后不可修改</div>
										</div>
									</div>
									<div class="layui-form-item">
										<button style="margin-bottom:10px;" class="layui-btn layui-btn-fluid" lay-filter="submit" lay-submit>立即发布</button>
						                <center><span ><a href="/essay/canclePublish.do">取消发布</a></span></center>
									</div>
								</form>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<div class="fly-footer">
			<p>Believe 社区 2019 &copy; 千夜 出品</p>
		</div>
		<script type="text/javascript" src="/resource/js/common.js"></script>
		<script src="/resource/js/jquery-3.4.0.min.js"></script>
		<script src="/resource/layui/layui.js"></script>
		<script src="/resource/js/essayadd.js"></script>
		<script>
			//检测session是否过期  或者未登录
			layui.use('layer',function(){
				$(document).ready(function(){
					var se="${user}";
					if(se==""){
					layer.alert('登录过期或未登录，请登录', function(index){
						  window.location.href="/login.html";
						  layer.close(index);
						}); 
					}
				});
			});
		</script>
	</body>
</html>
